<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/materialmanagement/MaterialManagement.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/demo/materialmanagement/MaterialManagement.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'MateriaanagementId',
            footer: "Foots",
            cnName: '物资采购表',
            name: 'materialmanagement/MaterialManagement',
            url: "/setpath/api/MaterialManagement/",
            sortName: "CreateTime"
        });
        const editFormFields = ref({ "GoodsName": "", "MaterialType": "", "MaterialIngredients": "", "MaterialSKU": "", "MaterialOrigin": "", "MaterialNum": "", "DeliveryDate": "", "UseDescription": "", "Remark": "" });
        const editFormOptions = ref([[{ "title": "货物名称", "field": "GoodsName", "type": "text" }],
        [{ "dataKey": "物资类型下拉框", "data": [], "title": "类型", "field": "MaterialType", "type": "select" }],
        [{ "dataKey": "物资材质下拉框", "data": [], "title": "材质", "field": "MaterialIngredients", "type": "select" }],
        [{ "title": "规格", "field": "MaterialSKU", "type": "text" }],
        [{ "dataKey": "产地-省", "data": [], "title": "产地", "field": "MaterialOrigin", "type": "select" }],
        [{ "title": "数量", "field": "MaterialNum", "type": "number" }],
        [{ "title": "期望交付日期", "field": "DeliveryDate", "type": "datetime" }],
        [{ "title": "用途描述", "field": "UseDescription", "type": "textarea" }],
        [{ "title": "备注", "field": "Remark", "type": "textarea" }]]);
        const searchFormFields = ref({ "GoodsName": "", "MaterialType": "", "MaterialIngredients": "", "Applicant": "", "AuditStatus": "" });
        const searchFormOptions = ref([[{ "title": "货物名称", "field": "GoodsName" }, { "dataKey": "物资类型下拉框", "data": [], "title": "类型", "field": "MaterialType", "type": "number" }, { "dataKey": "物资材质下拉框", "data": [], "title": "材质", "field": "MaterialIngredients", "type": "number" }], [{ "title": "申请人", "field": "Applicant" }, { "title": "审批状态", "field": "AuditStatus", "type": "number" }]]);
        const columns = ref([{ field: 'MateriaanagementId', title: '主键ID', type: 'string', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'GoodsName', title: '货物名称', type: 'string', width: 220, align: 'left', sort: true },
        { field: 'MaterialType', title: '类型', type: 'int', bind: { key: '物资类型下拉框', data: [] }, width: 110, align: 'left' },
        { field: 'MaterialIngredients', title: '材质', type: 'int', bind: { key: '物资材质下拉框', data: [] }, width: 110, align: 'left' },
        { field: 'MaterialSKU', title: '规格', type: 'string', width: 220, align: 'left' },
        { field: 'MaterialOrigin', title: '产地', type: 'string', bind: { key: '产地-省', data: [] }, width: 220, align: 'left' },
        { field: 'MaterialNum', title: '数量', type: 'int', width: 110, align: 'left' },
        { field: 'UseDescription', title: '用途描述', type: 'string', width: 220, align: 'left' },
        { field: 'Applicant', title: '申请人', type: 'string', width: 220, align: 'left' },
        { field: 'DeliveryDate', title: '期望交付日期', type: 'datetime', width: 150, align: 'left', sort: true },
        { field: 'Remark', title: '备注', type: 'string', width: 220, align: 'left' },
        { field: 'CreateTime', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
        { field: 'AuditStatus', title: '审批状态', type: 'int', width: 110, align: 'left' },
        { field: 'Approver', title: '审批人', type: 'string', width: 220, align: 'left' },
        { field: 'CreateName', title: '创建人', type: 'string', width: 220, align: 'left' },
        { field: 'UpdateName', title: '修改人', type: 'string', width: 220, align: 'left' },
        { field: 'UpdateTime', title: '修改时间', type: 'datetime', width: 150, align: 'left', sort: true },
        { field: 'IsDel', title: '逻辑删除', type: 'int', width: 110, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
